const wxaModule = {
	state: {
		activePageForm: {
			pageId: '',
			activeModuleIndex: null,
			modules: []
		},
		selectedTypes: [],
		selectedKeys: [],
		menuList: [],
		businessTypes: '',
    moduleData: {
      kaikaquanyi: []
    }
	},

	mutations: {
		SET_ACTIVE_PAGE_FORM: (state, data) => {
			state.activePageForm = data
		},
		SET_ACTIVE_PAGE_MODULES: (state, data) => {
			state.activePageForm.modules = data
		},
		SET_SELECTED_TYPES: (state, data) => {
			state.selectedTypes = data
		},
		SET_SELECTED_KEYS: (state, data) => {
			state.selectedKeys = data
		},
		SET_MENU_LIST: (state, data) => {
			state.menuList = data
		},
		SET_BUSINESS: (state, data) => {
			state.businessTypes = data
		},
	},

	actions: {
		setActivePageForm({
			commit
		}, data) {
			return new Promise((resolve, reject) => {
				commit('SET_ACTIVE_PAGE_FORM', data)
				resolve()
			})
		},
		setActivePageModules({
			commit
		}, data) {
			return new Promise((resolve, reject) => {
				commit('SET_ACTIVE_PAGE_MODULES', data)
				resolve()
			})
		},
		setSelectedTypes({
			commit
		}, data) {
			return new Promise((resolve, reject) => {
				commit('SET_SELECTED_TYPES', data)
				resolve()
			})
		},
		setMenuList({
			commit
		}, data) {
			return new Promise((resolve, reject) => {
				commit('SET_MENU_LIST', data)
				resolve()
			})
		},
		setSelectedKeys({
			commit
		}, data) {
			return new Promise((resolve, reject) => {
				commit('SET_SELECTED_KEYS', data)
				resolve()
			})
		},
		setActiveBuiness({
			commit
		}, data) {
			return new Promise((resolve, reject) => {
				commit('SET_BUSINESS', data)
				resolve()
			})
		},
	}
}

export default wxaModule
